Những câu hỏi liên quan
Dương Thu Ha
Xem chi tiết
Dương Thu Ha
6 tháng 3 2023 lúc 15:13

Giúp mk với mai mk kiểm tra r

Bình luận (0)
Minh Lệ
6 tháng 3 2023 lúc 23:44

Program HOC24;

var n: integer;

s: real;

begin

n:=1; s:=0;

while s<=3.15 do

begin

s:=s+n;

n:=n+2;

end;

write('S= ',s:5:2);

readln

end.

Bình luận (1)
NGUYỄN LÊ XUÂN THỊNH
Xem chi tiết
Nguyễn Lê Phước Thịnh
20 tháng 2 2023 lúc 0:38

Câu 6:

uses crt;

var n,i:integer;

begin

clrscr;

readln(n);

for i:=1 to n do 

if n mod i=0 then write(i:4);

readln;

end.

5:

uses crt;

var n,i,dem:integer;

begin

clrscr;

readln(n);

dem:=0;

for i:=0 to n do

if i mod 2=1 then 

begin

write(i:4);

dem:=dem+1;

end;

writeln;

writeln(dem);

readln;

end.

Bình luận (0)
Phan Thị Ka
Xem chi tiết
Minh Lệ
19 tháng 3 2023 lúc 22:40

Câu 1:

Program HOC24;

var i,p: integer;

t: longint;

begin

write('Nhap P: '); readln(p);

t:=0;

for i:=1 to p do if i mod 2<>0 then t:=t+i;

write('Tong cac so le la: ',t);

readln

end.

Bình luận (0)
Minh Lệ
19 tháng 3 2023 lúc 22:41

Câu 2:

Program HOC24;

var i,n: integer;

t: longint;

begin

write('Nhap N: '); readln(n);

t:=0;

for i:=1 to n do if i mod 2=0 then t:=t+i;

write('Tong cac so chan la: ',t);

readln

end.

Bình luận (0)
Minh Lệ
19 tháng 3 2023 lúc 22:42

Câu 3:

Program HOC24;

var i,t,n: integer;

begin

write('Nhap N: '); readln(n);

t:=0;

for i:=1 to n do if n mod i=0 then t:=t+i;

write('Tong cac uoc cua ',n,' la: ',t);

readln

end.

Bình luận (0)
San San
Xem chi tiết
Nguyễn Trung Hiếu
20 tháng 3 2022 lúc 7:21

Câu 1: 
uses crt;
var s,i,n:integer;
begin clrscr;
s:=0;
write('Nhap n: ');readln(n);
for i:=1 to n do
if i mod 2 <> 0 then inc(s,i);
write('Tong cac so le tu 1 den ',n,' la: ',s);
readln
end.

Bình luận (0)
Nguyễn Trung Hiếu
20 tháng 3 2022 lúc 7:22

Câu 2:
uses crt;
var s,i,n:integer;
begin clrscr;
s:=0;
write('Nhap n: ');readln(n);
for i:=1 to n do
if i mod 2 = 0 then inc(s,i);
write('Tong cac so le tu 1 den ',n,' la: ',s);
readln
end.

Bình luận (0)
Lê Thị Thùy Dung
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 2 2022 lúc 0:09

Bài 1: 

#include <bits/stdc++.h>

using namespace std;

long long i,n,x,t;

int main()

{

cin>>n;

t=0;

for (i=1; i<=n; i++)

{

cin>>x;

if (x%15==0) t=t+x;

}

cout<<t;

return 0;

}

Bình luận (0)
thu thu
Xem chi tiết
Thành Tân B1-
Xem chi tiết
Nguyễn Lê Phước Thịnh
23 tháng 12 2021 lúc 8:42

Bài 2: 

uses crt;

var x,i,n,dem:integer;

begin

clrscr;

readln(n);

dem:=0;

for i:=1 to n do 

begin

readln(x);

if x mod 2=0 then inc(dem);

end;

writeln(dem);

readln;

end.

Bình luận (1)
Trường Nguyễn
Xem chi tiết
Bao112233
18 tháng 12 2022 lúc 10:06

Cau 1:

var i,dem:integer;

function ngto(n:longint):boolean;
var bo:boolean;
i:longint;
begin
    bo:=true;
    for i:=2 to n-1 do 
    if n mod i=0 then bo:=false;
    if n>1 then ngto:=bo else ngto:=false;
end;
begin
    for i:=2 to 100 do 
    if ngto(i) then dem:=dem+i;
    write(dem);
readln;
end.

Cau 2:

var i,dem,n:longint;

begin
    read(n);
    dem:=1;
    for i:=1 to n do 
    dem:=dem*i;
    write(dem);
readln;
end.

Bình luận (0)
NT Phú
Xem chi tiết
Nguyễn Lê Phước Thịnh
27 tháng 10 2021 lúc 15:12

1: 

#include <bits/stdc++.h>

using namespace std;

long long n,i,s;

int main()

{

cin>>n;

s=0;

for (i=1; i<=n; i++)

s=s+i*i;

cout<<s;

return 0;

}

Bình luận (0)